package com.ruoyi.welcome.controller;


import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.welcome.service.YyySysUserRoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/stats/user")
public class YyyUserStatsController {

    @Autowired
    private YyySysUserRoleService sysUserRoleService;

    /**
     * 获取医生人数（role_id = 102）
     */
    @GetMapping("/doctor/count")
    public AjaxResult getDoctorCount() {
        int count = sysUserRoleService.getDoctorCount();
        return AjaxResult.success(count);
    }

    /**
     * 获取用户人数（role_id = 101）
     */
    @GetMapping("/user/count")
    public AjaxResult getUserCount() {
        int count = sysUserRoleService.getUserCount();
        return AjaxResult.success(count);
    }
}